{-# OPTIONS_GHC -w #-}
module Language.Coal.Parser(parse, Expression(..), Statement(..), Function(..)) where
import qualified Language.Coal.Lexer as L
import Language.Coal.RawAST
import qualified Language.Coal.Type as T

-- parser produced by Happy Version 1.18.6

data HappyAbsSyn t16 t17 t18
	= HappyTerminal (L.Token)
	| HappyErrorToken Int
	| HappyAbsSyn4 ([Function])
	| HappyAbsSyn5 (Function)
	| HappyAbsSyn6 ([(String, T.Type)])
	| HappyAbsSyn7 ([Statement])
	| HappyAbsSyn8 (Statement)
	| HappyAbsSyn9 (Expression)
	| HappyAbsSyn15 (T.Type)
	| HappyAbsSyn16 t16
	| HappyAbsSyn17 t17
	| HappyAbsSyn18 t18

action_0 (49) = happyShift action_3
action_0 (4) = happyGoto action_4
action_0 (5) = happyGoto action_5
action_0 _ = happyFail

action_1 (49) = happyShift action_3
action_1 (5) = happyGoto action_2
action_1 _ = happyFail

action_2 _ = happyFail

action_3 (22) = happyShift action_9
action_3 _ = happyFail

action_4 (51) = happyAccept
action_4 _ = happyFail

action_5 (33) = happyShift action_7
action_5 (44) = happyShift action_8
action_5 (18) = happyGoto action_6
action_5 _ = happyReduce_1

action_6 (49) = happyShift action_3
action_6 (4) = happyGoto action_14
action_6 (5) = happyGoto action_5
action_6 _ = happyFail

action_7 (33) = happyShift action_7
action_7 (44) = happyShift action_8
action_7 (18) = happyGoto action_13
action_7 _ = happyReduce_51

action_8 (33) = happyShift action_7
action_8 (44) = happyShift action_8
action_8 (18) = happyGoto action_12
action_8 _ = happyReduce_50

action_9 (31) = happyShift action_10
action_9 (34) = happyShift action_11
action_9 _ = happyFail

action_10 (22) = happyShift action_19
action_10 (6) = happyGoto action_18
action_10 _ = happyFail

action_11 (23) = happyShift action_16
action_11 (24) = happyShift action_17
action_11 (15) = happyGoto action_15
action_11 _ = happyFail

action_12 _ = happyReduce_48

action_13 _ = happyReduce_49

action_14 _ = happyReduce_2

action_15 (33) = happyShift action_7
action_15 (44) = happyShift action_8
action_15 (18) = happyGoto action_22
action_15 _ = happyFail

action_16 _ = happyReduce_40

action_17 _ = happyReduce_41

action_18 (32) = happyShift action_21
action_18 _ = happyFail

action_19 (34) = happyShift action_20
action_19 _ = happyFail

action_20 (23) = happyShift action_16
action_20 (24) = happyShift action_17
action_20 (15) = happyGoto action_39
action_20 _ = happyFail

action_21 (34) = happyShift action_38
action_21 _ = happyFail

action_22 (19) = happyShift action_31
action_22 (20) = happyShift action_32
action_22 (21) = happyShift action_33
action_22 (22) = happyShift action_34
action_22 (31) = happyShift action_35
action_22 (48) = happyShift action_36
action_22 (50) = happyShift action_37
action_22 (7) = happyGoto action_23
action_22 (8) = happyGoto action_24
action_22 (9) = happyGoto action_25
action_22 (10) = happyGoto action_26
action_22 (11) = happyGoto action_27
action_22 (12) = happyGoto action_28
action_22 (13) = happyGoto action_29
action_22 (14) = happyGoto action_30
action_22 _ = happyFail

action_23 (47) = happyShift action_62
action_23 _ = happyFail

action_24 (33) = happyShift action_7
action_24 (44) = happyShift action_8
action_24 (18) = happyGoto action_61
action_24 _ = happyReduce_7

action_25 (19) = happyShift action_59
action_25 (20) = happyShift action_60
action_25 _ = happyReduce_10

action_26 _ = happyReduce_21

action_27 (26) = happyShift action_51
action_27 (27) = happyShift action_52
action_27 (36) = happyShift action_53
action_27 (37) = happyShift action_54
action_27 (38) = happyShift action_55
action_27 (39) = happyShift action_56
action_27 (40) = happyShift action_57
action_27 (41) = happyShift action_58
action_27 _ = happyReduce_28

action_28 (28) = happyShift action_48
action_28 (29) = happyShift action_49
action_28 (30) = happyShift action_50
action_28 _ = happyReduce_31

action_29 _ = happyReduce_35

action_30 _ = happyReduce_36

action_31 (21) = happyShift action_33
action_31 (22) = happyShift action_34
action_31 (31) = happyShift action_35
action_31 (9) = happyGoto action_47
action_31 (10) = happyGoto action_26
action_31 (11) = happyGoto action_27
action_31 (12) = happyGoto action_28
action_31 (13) = happyGoto action_29
action_31 (14) = happyGoto action_30
action_31 _ = happyFail

action_32 (21) = happyShift action_33
action_32 (22) = happyShift action_34
action_32 (31) = happyShift action_35
action_32 (9) = happyGoto action_46
action_32 (10) = happyGoto action_26
action_32 (11) = happyGoto action_27
action_32 (12) = happyGoto action_28
action_32 (13) = happyGoto action_29
action_32 (14) = happyGoto action_30
action_32 _ = happyFail

action_33 _ = happyReduce_38

action_34 (25) = happyShift action_45
action_34 _ = happyReduce_39

action_35 (21) = happyShift action_33
action_35 (22) = happyShift action_34
action_35 (31) = happyShift action_35
action_35 (9) = happyGoto action_44
action_35 (10) = happyGoto action_26
action_35 (11) = happyGoto action_27
action_35 (12) = happyGoto action_28
action_35 (13) = happyGoto action_29
action_35 (14) = happyGoto action_30
action_35 _ = happyFail

action_36 (22) = happyShift action_43
action_36 _ = happyFail

action_37 (21) = happyShift action_33
action_37 (22) = happyShift action_34
action_37 (31) = happyShift action_35
action_37 (9) = happyGoto action_42
action_37 (10) = happyGoto action_26
action_37 (11) = happyGoto action_27
action_37 (12) = happyGoto action_28
action_37 (13) = happyGoto action_29
action_37 (14) = happyGoto action_30
action_37 _ = happyFail

action_38 (23) = happyShift action_16
action_38 (24) = happyShift action_17
action_38 (15) = happyGoto action_41
action_38 _ = happyFail

action_39 (35) = happyShift action_40
action_39 _ = happyReduce_5

action_40 (22) = happyShift action_19
action_40 (6) = happyGoto action_89
action_40 _ = happyFail

action_41 (33) = happyShift action_7
action_41 (44) = happyShift action_8
action_41 (18) = happyGoto action_88
action_41 _ = happyFail

action_42 _ = happyReduce_19

action_43 (25) = happyShift action_86
action_43 (34) = happyShift action_87
action_43 _ = happyReduce_13

action_44 (32) = happyShift action_85
action_44 _ = happyFail

action_45 (21) = happyShift action_33
action_45 (22) = happyShift action_34
action_45 (31) = happyShift action_35
action_45 (9) = happyGoto action_84
action_45 (10) = happyGoto action_26
action_45 (11) = happyGoto action_27
action_45 (12) = happyGoto action_28
action_45 (13) = happyGoto action_29
action_45 (14) = happyGoto action_30
action_45 _ = happyFail

action_46 (33) = happyShift action_7
action_46 (44) = happyShift action_8
action_46 (45) = happyShift action_83
action_46 (16) = happyGoto action_81
action_46 (18) = happyGoto action_82
action_46 _ = happyFail

action_47 (33) = happyShift action_7
action_47 (44) = happyShift action_8
action_47 (46) = happyShift action_80
action_47 (17) = happyGoto action_78
action_47 (18) = happyGoto action_79
action_47 _ = happyFail

action_48 (21) = happyShift action_33
action_48 (22) = happyShift action_67
action_48 (31) = happyShift action_35
action_48 (13) = happyGoto action_77
action_48 (14) = happyGoto action_30
action_48 _ = happyFail

action_49 (21) = happyShift action_33
action_49 (22) = happyShift action_67
action_49 (31) = happyShift action_35
action_49 (13) = happyGoto action_76
action_49 (14) = happyGoto action_30
action_49 _ = happyFail

action_50 (21) = happyShift action_33
action_50 (22) = happyShift action_67
action_50 (31) = happyShift action_35
action_50 (13) = happyGoto action_75
action_50 (14) = happyGoto action_30
action_50 _ = happyFail

action_51 (21) = happyShift action_33
action_51 (22) = happyShift action_67
action_51 (31) = happyShift action_35
action_51 (12) = happyGoto action_74
action_51 (13) = happyGoto action_29
action_51 (14) = happyGoto action_30
action_51 _ = happyFail

action_52 (21) = happyShift action_33
action_52 (22) = happyShift action_67
action_52 (31) = happyShift action_35
action_52 (12) = happyGoto action_73
action_52 (13) = happyGoto action_29
action_52 (14) = happyGoto action_30
action_52 _ = happyFail

action_53 (21) = happyShift action_33
action_53 (22) = happyShift action_67
action_53 (31) = happyShift action_35
action_53 (11) = happyGoto action_72
action_53 (12) = happyGoto action_28
action_53 (13) = happyGoto action_29
action_53 (14) = happyGoto action_30
action_53 _ = happyFail

action_54 (21) = happyShift action_33
action_54 (22) = happyShift action_67
action_54 (31) = happyShift action_35
action_54 (11) = happyGoto action_71
action_54 (12) = happyGoto action_28
action_54 (13) = happyGoto action_29
action_54 (14) = happyGoto action_30
action_54 _ = happyFail

action_55 (21) = happyShift action_33
action_55 (22) = happyShift action_67
action_55 (31) = happyShift action_35
action_55 (11) = happyGoto action_70
action_55 (12) = happyGoto action_28
action_55 (13) = happyGoto action_29
action_55 (14) = happyGoto action_30
action_55 _ = happyFail

action_56 (21) = happyShift action_33
action_56 (22) = happyShift action_67
action_56 (31) = happyShift action_35
action_56 (11) = happyGoto action_69
action_56 (12) = happyGoto action_28
action_56 (13) = happyGoto action_29
action_56 (14) = happyGoto action_30
action_56 _ = happyFail

action_57 (21) = happyShift action_33
action_57 (22) = happyShift action_67
action_57 (31) = happyShift action_35
action_57 (11) = happyGoto action_68
action_57 (12) = happyGoto action_28
action_57 (13) = happyGoto action_29
action_57 (14) = happyGoto action_30
action_57 _ = happyFail

action_58 (21) = happyShift action_33
action_58 (22) = happyShift action_67
action_58 (31) = happyShift action_35
action_58 (11) = happyGoto action_66
action_58 (12) = happyGoto action_28
action_58 (13) = happyGoto action_29
action_58 (14) = happyGoto action_30
action_58 _ = happyFail

action_59 (21) = happyShift action_33
action_59 (22) = happyShift action_34
action_59 (31) = happyShift action_35
action_59 (9) = happyGoto action_65
action_59 (10) = happyGoto action_26
action_59 (11) = happyGoto action_27
action_59 (12) = happyGoto action_28
action_59 (13) = happyGoto action_29
action_59 (14) = happyGoto action_30
action_59 _ = happyFail

action_60 (21) = happyShift action_33
action_60 (22) = happyShift action_34
action_60 (31) = happyShift action_35
action_60 (9) = happyGoto action_64
action_60 (10) = happyGoto action_26
action_60 (11) = happyGoto action_27
action_60 (12) = happyGoto action_28
action_60 (13) = happyGoto action_29
action_60 (14) = happyGoto action_30
action_60 _ = happyFail

action_61 (19) = happyShift action_31
action_61 (20) = happyShift action_32
action_61 (21) = happyShift action_33
action_61 (22) = happyShift action_34
action_61 (31) = happyShift action_35
action_61 (48) = happyShift action_36
action_61 (50) = happyShift action_37
action_61 (7) = happyGoto action_63
action_61 (8) = happyGoto action_24
action_61 (9) = happyGoto action_25
action_61 (10) = happyGoto action_26
action_61 (11) = happyGoto action_27
action_61 (12) = happyGoto action_28
action_61 (13) = happyGoto action_29
action_61 (14) = happyGoto action_30
action_61 _ = happyReduce_8

action_62 _ = happyReduce_4

action_63 _ = happyReduce_9

action_64 _ = happyReduce_17

action_65 _ = happyReduce_18

action_66 (26) = happyShift action_51
action_66 (27) = happyShift action_52
action_66 _ = happyReduce_27

action_67 _ = happyReduce_39

action_68 (26) = happyShift action_51
action_68 (27) = happyShift action_52
action_68 _ = happyReduce_26

action_69 (26) = happyShift action_51
action_69 (27) = happyShift action_52
action_69 _ = happyReduce_25

action_70 (26) = happyShift action_51
action_70 (27) = happyShift action_52
action_70 _ = happyReduce_24

action_71 (26) = happyShift action_51
action_71 (27) = happyShift action_52
action_71 _ = happyReduce_23

action_72 (26) = happyShift action_51
action_72 (27) = happyShift action_52
action_72 _ = happyReduce_22

action_73 (28) = happyShift action_48
action_73 (29) = happyShift action_49
action_73 (30) = happyShift action_50
action_73 _ = happyReduce_30

action_74 (28) = happyShift action_48
action_74 (29) = happyShift action_49
action_74 (30) = happyShift action_50
action_74 _ = happyReduce_29

action_75 _ = happyReduce_34

action_76 _ = happyReduce_33

action_77 _ = happyReduce_32

action_78 (19) = happyShift action_31
action_78 (20) = happyShift action_32
action_78 (21) = happyShift action_33
action_78 (22) = happyShift action_34
action_78 (31) = happyShift action_35
action_78 (48) = happyShift action_36
action_78 (50) = happyShift action_37
action_78 (7) = happyGoto action_96
action_78 (8) = happyGoto action_24
action_78 (9) = happyGoto action_25
action_78 (10) = happyGoto action_26
action_78 (11) = happyGoto action_27
action_78 (12) = happyGoto action_28
action_78 (13) = happyGoto action_29
action_78 (14) = happyGoto action_30
action_78 _ = happyFail

action_79 (46) = happyShift action_95
action_79 _ = happyReduce_45

action_80 _ = happyReduce_46

action_81 (19) = happyShift action_31
action_81 (20) = happyShift action_32
action_81 (21) = happyShift action_33
action_81 (22) = happyShift action_34
action_81 (31) = happyShift action_35
action_81 (48) = happyShift action_36
action_81 (50) = happyShift action_37
action_81 (7) = happyGoto action_94
action_81 (8) = happyGoto action_24
action_81 (9) = happyGoto action_25
action_81 (10) = happyGoto action_26
action_81 (11) = happyGoto action_27
action_81 (12) = happyGoto action_28
action_81 (13) = happyGoto action_29
action_81 (14) = happyGoto action_30
action_81 _ = happyFail

action_82 (45) = happyShift action_93
action_82 _ = happyReduce_42

action_83 _ = happyReduce_43

action_84 _ = happyReduce_20

action_85 _ = happyReduce_37

action_86 (21) = happyShift action_33
action_86 (22) = happyShift action_34
action_86 (31) = happyShift action_35
action_86 (9) = happyGoto action_92
action_86 (10) = happyGoto action_26
action_86 (11) = happyGoto action_27
action_86 (12) = happyGoto action_28
action_86 (13) = happyGoto action_29
action_86 (14) = happyGoto action_30
action_86 _ = happyFail

action_87 (23) = happyShift action_16
action_87 (24) = happyShift action_17
action_87 (15) = happyGoto action_91
action_87 _ = happyFail

action_88 (19) = happyShift action_31
action_88 (20) = happyShift action_32
action_88 (21) = happyShift action_33
action_88 (22) = happyShift action_34
action_88 (31) = happyShift action_35
action_88 (48) = happyShift action_36
action_88 (50) = happyShift action_37
action_88 (7) = happyGoto action_90
action_88 (8) = happyGoto action_24
action_88 (9) = happyGoto action_25
action_88 (10) = happyGoto action_26
action_88 (11) = happyGoto action_27
action_88 (12) = happyGoto action_28
action_88 (13) = happyGoto action_29
action_88 (14) = happyGoto action_30
action_88 _ = happyFail

action_89 _ = happyReduce_6

action_90 (47) = happyShift action_100
action_90 _ = happyFail

action_91 (25) = happyShift action_99
action_91 _ = happyReduce_11

action_92 _ = happyReduce_14

action_93 _ = happyReduce_44

action_94 (47) = happyShift action_98
action_94 _ = happyFail

action_95 _ = happyReduce_47

action_96 (47) = happyShift action_97
action_96 _ = happyFail

action_97 _ = happyReduce_16

action_98 _ = happyReduce_15

action_99 (21) = happyShift action_33
action_99 (22) = happyShift action_34
action_99 (31) = happyShift action_35
action_99 (9) = happyGoto action_101
action_99 (10) = happyGoto action_26
action_99 (11) = happyGoto action_27
action_99 (12) = happyGoto action_28
action_99 (13) = happyGoto action_29
action_99 (14) = happyGoto action_30
action_99 _ = happyFail

action_100 _ = happyReduce_3

action_101 _ = happyReduce_12

happyReduce_1 = happySpecReduce_1  4 happyReduction_1
happyReduction_1 (HappyAbsSyn5  happy_var_1)
	 =  HappyAbsSyn4
		 ([happy_var_1]
	)
happyReduction_1 _  = notHappyAtAll 

happyReduce_2 = happySpecReduce_3  4 happyReduction_2
happyReduction_2 (HappyAbsSyn4  happy_var_3)
	_
	(HappyAbsSyn5  happy_var_1)
	 =  HappyAbsSyn4
		 (happy_var_1 : happy_var_3
	)
happyReduction_2 _ _ _  = notHappyAtAll 

happyReduce_3 = happyReduce 10 5 happyReduction_3
happyReduction_3 (_ `HappyStk`
	(HappyAbsSyn7  happy_var_9) `HappyStk`
	_ `HappyStk`
	(HappyAbsSyn15  happy_var_7) `HappyStk`
	_ `HappyStk`
	_ `HappyStk`
	(HappyAbsSyn6  happy_var_4) `HappyStk`
	_ `HappyStk`
	(HappyTerminal (L.Identificator happy_var_2)) `HappyStk`
	_ `HappyStk`
	happyRest)
	 = HappyAbsSyn5
		 ((Function {name = happy_var_2, args = happy_var_4, body = happy_var_9, rtype = happy_var_7})
	) `HappyStk` happyRest

happyReduce_4 = happyReduce 7 5 happyReduction_4
happyReduction_4 (_ `HappyStk`
	(HappyAbsSyn7  happy_var_6) `HappyStk`
	_ `HappyStk`
	(HappyAbsSyn15  happy_var_4) `HappyStk`
	_ `HappyStk`
	(HappyTerminal (L.Identificator happy_var_2)) `HappyStk`
	_ `HappyStk`
	happyRest)
	 = HappyAbsSyn5
		 ((Function {name = happy_var_2, args = [], body = happy_var_6, rtype = happy_var_4})
	) `HappyStk` happyRest

happyReduce_5 = happySpecReduce_3  6 happyReduction_5
happyReduction_5 (HappyAbsSyn15  happy_var_3)
	_
	(HappyTerminal (L.Identificator happy_var_1))
	 =  HappyAbsSyn6
		 ([(happy_var_1, happy_var_3)]
	)
happyReduction_5 _ _ _  = notHappyAtAll 

happyReduce_6 = happyReduce 5 6 happyReduction_6
happyReduction_6 ((HappyAbsSyn6  happy_var_5) `HappyStk`
	_ `HappyStk`
	(HappyAbsSyn15  happy_var_3) `HappyStk`
	_ `HappyStk`
	(HappyTerminal (L.Identificator happy_var_1)) `HappyStk`
	happyRest)
	 = HappyAbsSyn6
		 ((happy_var_1, happy_var_3) : happy_var_5
	) `HappyStk` happyRest

happyReduce_7 = happySpecReduce_1  7 happyReduction_7
happyReduction_7 (HappyAbsSyn8  happy_var_1)
	 =  HappyAbsSyn7
		 ([happy_var_1]
	)
happyReduction_7 _  = notHappyAtAll 

happyReduce_8 = happySpecReduce_2  7 happyReduction_8
happyReduction_8 _
	(HappyAbsSyn8  happy_var_1)
	 =  HappyAbsSyn7
		 ([happy_var_1]
	)
happyReduction_8 _ _  = notHappyAtAll 

happyReduce_9 = happySpecReduce_3  7 happyReduction_9
happyReduction_9 (HappyAbsSyn7  happy_var_3)
	_
	(HappyAbsSyn8  happy_var_1)
	 =  HappyAbsSyn7
		 (happy_var_1 : happy_var_3
	)
happyReduction_9 _ _ _  = notHappyAtAll 

happyReduce_10 = happySpecReduce_1  8 happyReduction_10
happyReduction_10 (HappyAbsSyn9  happy_var_1)
	 =  HappyAbsSyn8
		 (Expression happy_var_1
	)
happyReduction_10 _  = notHappyAtAll 

happyReduce_11 = happyReduce 4 8 happyReduction_11
happyReduction_11 ((HappyAbsSyn15  happy_var_4) `HappyStk`
	_ `HappyStk`
	(HappyTerminal (L.Identificator happy_var_2)) `HappyStk`
	_ `HappyStk`
	happyRest)
	 = HappyAbsSyn8
		 (Declare happy_var_2 (Just happy_var_4)
	) `HappyStk` happyRest

happyReduce_12 = happyReduce 6 8 happyReduction_12
happyReduction_12 ((HappyAbsSyn9  happy_var_6) `HappyStk`
	_ `HappyStk`
	(HappyAbsSyn15  happy_var_4) `HappyStk`
	_ `HappyStk`
	(HappyTerminal (L.Identificator happy_var_2)) `HappyStk`
	_ `HappyStk`
	happyRest)
	 = HappyAbsSyn8
		 (DeclareAndAsign happy_var_2 happy_var_6 (Just happy_var_4)
	) `HappyStk` happyRest

happyReduce_13 = happySpecReduce_2  8 happyReduction_13
happyReduction_13 (HappyTerminal (L.Identificator happy_var_2))
	_
	 =  HappyAbsSyn8
		 (Declare happy_var_2 Nothing
	)
happyReduction_13 _ _  = notHappyAtAll 

happyReduce_14 = happyReduce 4 8 happyReduction_14
happyReduction_14 ((HappyAbsSyn9  happy_var_4) `HappyStk`
	_ `HappyStk`
	(HappyTerminal (L.Identificator happy_var_2)) `HappyStk`
	_ `HappyStk`
	happyRest)
	 = HappyAbsSyn8
		 (DeclareAndAsign happy_var_2 happy_var_4 Nothing
	) `HappyStk` happyRest

happyReduce_15 = happyReduce 5 8 happyReduction_15
happyReduction_15 (_ `HappyStk`
	(HappyAbsSyn7  happy_var_4) `HappyStk`
	_ `HappyStk`
	(HappyAbsSyn9  happy_var_2) `HappyStk`
	_ `HappyStk`
	happyRest)
	 = HappyAbsSyn8
		 (If happy_var_2 happy_var_4
	) `HappyStk` happyRest

happyReduce_16 = happyReduce 5 8 happyReduction_16
happyReduction_16 (_ `HappyStk`
	(HappyAbsSyn7  happy_var_4) `HappyStk`
	_ `HappyStk`
	(HappyAbsSyn9  happy_var_2) `HappyStk`
	_ `HappyStk`
	happyRest)
	 = HappyAbsSyn8
		 (While happy_var_2 happy_var_4
	) `HappyStk` happyRest

happyReduce_17 = happySpecReduce_3  8 happyReduction_17
happyReduction_17 (HappyAbsSyn9  happy_var_3)
	_
	(HappyAbsSyn9  happy_var_1)
	 =  HappyAbsSyn8
		 (If happy_var_3 [Expression happy_var_1]
	)
happyReduction_17 _ _ _  = notHappyAtAll 

happyReduce_18 = happySpecReduce_3  8 happyReduction_18
happyReduction_18 (HappyAbsSyn9  happy_var_3)
	_
	(HappyAbsSyn9  happy_var_1)
	 =  HappyAbsSyn8
		 (While happy_var_3 [Expression happy_var_1]
	)
happyReduction_18 _ _ _  = notHappyAtAll 

happyReduce_19 = happySpecReduce_2  8 happyReduction_19
happyReduction_19 (HappyAbsSyn9  happy_var_2)
	_
	 =  HappyAbsSyn8
		 (Return happy_var_2
	)
happyReduction_19 _ _  = notHappyAtAll 

happyReduce_20 = happySpecReduce_3  9 happyReduction_20
happyReduction_20 (HappyAbsSyn9  happy_var_3)
	_
	(HappyTerminal (L.Identificator happy_var_1))
	 =  HappyAbsSyn9
		 (Asign happy_var_1 happy_var_3
	)
happyReduction_20 _ _ _  = notHappyAtAll 

happyReduce_21 = happySpecReduce_1  9 happyReduction_21
happyReduction_21 (HappyAbsSyn9  happy_var_1)
	 =  HappyAbsSyn9
		 (happy_var_1
	)
happyReduction_21 _  = notHappyAtAll 

happyReduce_22 = happySpecReduce_3  10 happyReduction_22
happyReduction_22 (HappyAbsSyn9  happy_var_3)
	_
	(HappyAbsSyn9  happy_var_1)
	 =  HappyAbsSyn9
		 (Call "==" [happy_var_1, happy_var_3]
	)
happyReduction_22 _ _ _  = notHappyAtAll 

happyReduce_23 = happySpecReduce_3  10 happyReduction_23
happyReduction_23 (HappyAbsSyn9  happy_var_3)
	_
	(HappyAbsSyn9  happy_var_1)
	 =  HappyAbsSyn9
		 (Call "!=" [happy_var_1, happy_var_3]
	)
happyReduction_23 _ _ _  = notHappyAtAll 

happyReduce_24 = happySpecReduce_3  10 happyReduction_24
happyReduction_24 (HappyAbsSyn9  happy_var_3)
	_
	(HappyAbsSyn9  happy_var_1)
	 =  HappyAbsSyn9
		 (Call "<" [happy_var_1, happy_var_3]
	)
happyReduction_24 _ _ _  = notHappyAtAll 

happyReduce_25 = happySpecReduce_3  10 happyReduction_25
happyReduction_25 (HappyAbsSyn9  happy_var_3)
	_
	(HappyAbsSyn9  happy_var_1)
	 =  HappyAbsSyn9
		 (Call ">" [happy_var_1, happy_var_3]
	)
happyReduction_25 _ _ _  = notHappyAtAll 

happyReduce_26 = happySpecReduce_3  10 happyReduction_26
happyReduction_26 (HappyAbsSyn9  happy_var_3)
	_
	(HappyAbsSyn9  happy_var_1)
	 =  HappyAbsSyn9
		 (Call "<=" [happy_var_1, happy_var_3]
	)
happyReduction_26 _ _ _  = notHappyAtAll 

happyReduce_27 = happySpecReduce_3  10 happyReduction_27
happyReduction_27 (HappyAbsSyn9  happy_var_3)
	_
	(HappyAbsSyn9  happy_var_1)
	 =  HappyAbsSyn9
		 (Call ">=" [happy_var_1, happy_var_3]
	)
happyReduction_27 _ _ _  = notHappyAtAll 

happyReduce_28 = happySpecReduce_1  10 happyReduction_28
happyReduction_28 (HappyAbsSyn9  happy_var_1)
	 =  HappyAbsSyn9
		 (happy_var_1
	)
happyReduction_28 _  = notHappyAtAll 

happyReduce_29 = happySpecReduce_3  11 happyReduction_29
happyReduction_29 (HappyAbsSyn9  happy_var_3)
	_
	(HappyAbsSyn9  happy_var_1)
	 =  HappyAbsSyn9
		 (Call "+" [happy_var_1, happy_var_3]
	)
happyReduction_29 _ _ _  = notHappyAtAll 

happyReduce_30 = happySpecReduce_3  11 happyReduction_30
happyReduction_30 (HappyAbsSyn9  happy_var_3)
	_
	(HappyAbsSyn9  happy_var_1)
	 =  HappyAbsSyn9
		 (Call "-" [happy_var_1, happy_var_3]
	)
happyReduction_30 _ _ _  = notHappyAtAll 

happyReduce_31 = happySpecReduce_1  11 happyReduction_31
happyReduction_31 (HappyAbsSyn9  happy_var_1)
	 =  HappyAbsSyn9
		 (happy_var_1
	)
happyReduction_31 _  = notHappyAtAll 

happyReduce_32 = happySpecReduce_3  12 happyReduction_32
happyReduction_32 (HappyAbsSyn9  happy_var_3)
	_
	(HappyAbsSyn9  happy_var_1)
	 =  HappyAbsSyn9
		 (Call "*" [happy_var_1, happy_var_3]
	)
happyReduction_32 _ _ _  = notHappyAtAll 

happyReduce_33 = happySpecReduce_3  12 happyReduction_33
happyReduction_33 (HappyAbsSyn9  happy_var_3)
	_
	(HappyAbsSyn9  happy_var_1)
	 =  HappyAbsSyn9
		 (Call "/" [happy_var_1, happy_var_3]
	)
happyReduction_33 _ _ _  = notHappyAtAll 

happyReduce_34 = happySpecReduce_3  12 happyReduction_34
happyReduction_34 (HappyAbsSyn9  happy_var_3)
	_
	(HappyAbsSyn9  happy_var_1)
	 =  HappyAbsSyn9
		 (Call "%" [happy_var_1, happy_var_3]
	)
happyReduction_34 _ _ _  = notHappyAtAll 

happyReduce_35 = happySpecReduce_1  12 happyReduction_35
happyReduction_35 (HappyAbsSyn9  happy_var_1)
	 =  HappyAbsSyn9
		 (happy_var_1
	)
happyReduction_35 _  = notHappyAtAll 

happyReduce_36 = happySpecReduce_1  13 happyReduction_36
happyReduction_36 (HappyAbsSyn9  happy_var_1)
	 =  HappyAbsSyn9
		 (happy_var_1
	)
happyReduction_36 _  = notHappyAtAll 

happyReduce_37 = happySpecReduce_3  13 happyReduction_37
happyReduction_37 _
	(HappyAbsSyn9  happy_var_2)
	_
	 =  HappyAbsSyn9
		 (happy_var_2
	)
happyReduction_37 _ _ _  = notHappyAtAll 

happyReduce_38 = happySpecReduce_1  14 happyReduction_38
happyReduction_38 (HappyTerminal (L.Integer happy_var_1))
	 =  HappyAbsSyn9
		 (Integer happy_var_1
	)
happyReduction_38 _  = notHappyAtAll 

happyReduce_39 = happySpecReduce_1  14 happyReduction_39
happyReduction_39 (HappyTerminal (L.Identificator happy_var_1))
	 =  HappyAbsSyn9
		 (Identificator happy_var_1
	)
happyReduction_39 _  = notHappyAtAll 

happyReduce_40 = happySpecReduce_1  15 happyReduction_40
happyReduction_40 _
	 =  HappyAbsSyn15
		 (T.integer
	)

happyReduce_41 = happySpecReduce_1  15 happyReduction_41
happyReduction_41 _
	 =  HappyAbsSyn15
		 (T.boolean
	)

happyReduce_42 = happySpecReduce_1  16 happyReduction_42
happyReduction_42 _
	 =  HappyAbsSyn16
		 (
	)

happyReduce_43 = happySpecReduce_1  16 happyReduction_43
happyReduction_43 _
	 =  HappyAbsSyn16
		 (
	)

happyReduce_44 = happySpecReduce_2  16 happyReduction_44
happyReduction_44 _
	_
	 =  HappyAbsSyn16
		 (
	)

happyReduce_45 = happySpecReduce_1  17 happyReduction_45
happyReduction_45 _
	 =  HappyAbsSyn17
		 (
	)

happyReduce_46 = happySpecReduce_1  17 happyReduction_46
happyReduction_46 _
	 =  HappyAbsSyn17
		 (
	)

happyReduce_47 = happySpecReduce_2  17 happyReduction_47
happyReduction_47 _
	_
	 =  HappyAbsSyn17
		 (
	)

happyReduce_48 = happySpecReduce_2  18 happyReduction_48
happyReduction_48 _
	_
	 =  HappyAbsSyn18
		 (
	)

happyReduce_49 = happySpecReduce_2  18 happyReduction_49
happyReduction_49 _
	_
	 =  HappyAbsSyn18
		 (
	)

happyReduce_50 = happySpecReduce_1  18 happyReduction_50
happyReduction_50 _
	 =  HappyAbsSyn18
		 (
	)

happyReduce_51 = happySpecReduce_1  18 happyReduction_51
happyReduction_51 _
	 =  HappyAbsSyn18
		 (
	)

happyNewToken action sts stk [] =
	action 51 51 notHappyAtAll (HappyState action) sts stk []

happyNewToken action sts stk (tk:tks) =
	let cont i = action i i tk (HappyState action) sts stk tks in
	case tk of {
	L.While -> cont 19;
	L.If -> cont 20;
	L.Integer happy_dollar_dollar -> cont 21;
	L.Identificator happy_dollar_dollar -> cont 22;
	L.IntType -> cont 23;
	L.BoolType -> cont 24;
	L.Asign -> cont 25;
	L.Plus -> cont 26;
	L.Minus -> cont 27;
	L.Times -> cont 28;
	L.Divide -> cont 29;
	L.Rem -> cont 30;
	L.OpenParenth -> cont 31;
	L.CloseParenth -> cont 32;
	L.Semicolon -> cont 33;
	L.Colon -> cont 34;
	L.Coma -> cont 35;
	L.Equal -> cont 36;
	L.NotEqual -> cont 37;
	L.Less -> cont 38;
	L.Greater -> cont 39;
	L.LessEqual -> cont 40;
	L.GreaterEqual -> cont 41;
	L.OpenBrace -> cont 42;
	L.CloseBrace -> cont 43;
	L.Newline -> cont 44;
	L.Then -> cont 45;
	L.Do -> cont 46;
	L.End -> cont 47;
	L.Var -> cont 48;
	L.Def -> cont 49;
	L.Return -> cont 50;
	_ -> happyError' (tk:tks)
	}

happyError_ tk tks = happyError' (tk:tks)

newtype HappyIdentity a = HappyIdentity a
happyIdentity = HappyIdentity
happyRunIdentity (HappyIdentity a) = a

instance Monad HappyIdentity where
    return = HappyIdentity
    (HappyIdentity p) >>= q = q p

happyThen :: () => HappyIdentity a -> (a -> HappyIdentity b) -> HappyIdentity b
happyThen = (>>=)
happyReturn :: () => a -> HappyIdentity a
happyReturn = (return)
happyThen1 m k tks = (>>=) m (\a -> k a tks)
happyReturn1 :: () => a -> b -> HappyIdentity a
happyReturn1 = \a tks -> (return) a
happyError' :: () => [(L.Token)] -> HappyIdentity a
happyError' = HappyIdentity . parseError

parse tks = happyRunIdentity happySomeParser where
  happySomeParser = happyThen (happyParse action_0 tks) (\x -> case x of {HappyAbsSyn4 z -> happyReturn z; _other -> notHappyAtAll })

happySeq = happyDontSeq


parseError :: [L.Token] -> a
parseError t = error ("Parse error " ++ (show t))
{-# LINE 1 "templates\GenericTemplate.hs" #-}
{-# LINE 1 "templates\\GenericTemplate.hs" #-}
{-# LINE 1 "<built-in>" #-}
{-# LINE 1 "<command-line>" #-}
{-# LINE 1 "templates\\GenericTemplate.hs" #-}
-- Id: GenericTemplate.hs,v 1.26 2005/01/14 14:47:22 simonmar Exp 

{-# LINE 30 "templates\\GenericTemplate.hs" #-}








{-# LINE 51 "templates\\GenericTemplate.hs" #-}

{-# LINE 61 "templates\\GenericTemplate.hs" #-}

{-# LINE 70 "templates\\GenericTemplate.hs" #-}

infixr 9 `HappyStk`
data HappyStk a = HappyStk a (HappyStk a)

-----------------------------------------------------------------------------
-- starting the parse

happyParse start_state = happyNewToken start_state notHappyAtAll notHappyAtAll

-----------------------------------------------------------------------------
-- Accepting the parse

-- If the current token is (1), it means we've just accepted a partial
-- parse (a %partial parser).  We must ignore the saved token on the top of
-- the stack in this case.
happyAccept (1) tk st sts (_ `HappyStk` ans `HappyStk` _) =
	happyReturn1 ans
happyAccept j tk st sts (HappyStk ans _) = 
	 (happyReturn1 ans)

-----------------------------------------------------------------------------
-- Arrays only: do the next action

{-# LINE 148 "templates\\GenericTemplate.hs" #-}

-----------------------------------------------------------------------------
-- HappyState data type (not arrays)



newtype HappyState b c = HappyState
        (Int ->                    -- token number
         Int ->                    -- token number (yes, again)
         b ->                           -- token semantic value
         HappyState b c ->              -- current state
         [HappyState b c] ->            -- state stack
         c)



-----------------------------------------------------------------------------
-- Shifting a token

happyShift new_state (1) tk st sts stk@(x `HappyStk` _) =
     let (i) = (case x of { HappyErrorToken (i) -> i }) in
--     trace "shifting the error token" $
     new_state i i tk (HappyState (new_state)) ((st):(sts)) (stk)

happyShift new_state i tk st sts stk =
     happyNewToken new_state ((st):(sts)) ((HappyTerminal (tk))`HappyStk`stk)

-- happyReduce is specialised for the common cases.

happySpecReduce_0 i fn (1) tk st sts stk
     = happyFail (1) tk st sts stk
happySpecReduce_0 nt fn j tk st@((HappyState (action))) sts stk
     = action nt j tk st ((st):(sts)) (fn `HappyStk` stk)

happySpecReduce_1 i fn (1) tk st sts stk
     = happyFail (1) tk st sts stk
happySpecReduce_1 nt fn j tk _ sts@(((st@(HappyState (action))):(_))) (v1`HappyStk`stk')
     = let r = fn v1 in
       happySeq r (action nt j tk st sts (r `HappyStk` stk'))

happySpecReduce_2 i fn (1) tk st sts stk
     = happyFail (1) tk st sts stk
happySpecReduce_2 nt fn j tk _ ((_):(sts@(((st@(HappyState (action))):(_))))) (v1`HappyStk`v2`HappyStk`stk')
     = let r = fn v1 v2 in
       happySeq r (action nt j tk st sts (r `HappyStk` stk'))

happySpecReduce_3 i fn (1) tk st sts stk
     = happyFail (1) tk st sts stk
happySpecReduce_3 nt fn j tk _ ((_):(((_):(sts@(((st@(HappyState (action))):(_))))))) (v1`HappyStk`v2`HappyStk`v3`HappyStk`stk')
     = let r = fn v1 v2 v3 in
       happySeq r (action nt j tk st sts (r `HappyStk` stk'))

happyReduce k i fn (1) tk st sts stk
     = happyFail (1) tk st sts stk
happyReduce k nt fn j tk st sts stk
     = case happyDrop (k - ((1) :: Int)) sts of
	 sts1@(((st1@(HappyState (action))):(_))) ->
        	let r = fn stk in  -- it doesn't hurt to always seq here...
       		happyDoSeq r (action nt j tk st1 sts1 r)

happyMonadReduce k nt fn (1) tk st sts stk
     = happyFail (1) tk st sts stk
happyMonadReduce k nt fn j tk st sts stk =
        happyThen1 (fn stk tk) (\r -> action nt j tk st1 sts1 (r `HappyStk` drop_stk))
       where (sts1@(((st1@(HappyState (action))):(_)))) = happyDrop k ((st):(sts))
             drop_stk = happyDropStk k stk

happyMonad2Reduce k nt fn (1) tk st sts stk
     = happyFail (1) tk st sts stk
happyMonad2Reduce k nt fn j tk st sts stk =
       happyThen1 (fn stk tk) (\r -> happyNewToken new_state sts1 (r `HappyStk` drop_stk))
       where (sts1@(((st1@(HappyState (action))):(_)))) = happyDrop k ((st):(sts))
             drop_stk = happyDropStk k stk





             new_state = action


happyDrop (0) l = l
happyDrop n ((_):(t)) = happyDrop (n - ((1) :: Int)) t

happyDropStk (0) l = l
happyDropStk n (x `HappyStk` xs) = happyDropStk (n - ((1)::Int)) xs

-----------------------------------------------------------------------------
-- Moving to a new state after a reduction

{-# LINE 246 "templates\\GenericTemplate.hs" #-}
happyGoto action j tk st = action j j tk (HappyState action)


-----------------------------------------------------------------------------
-- Error recovery ((1) is the error token)

-- parse error if we are in recovery and we fail again
happyFail  (1) tk old_st _ stk =
--	trace "failing" $ 
    	happyError_ tk

{-  We don't need state discarding for our restricted implementation of
    "error".  In fact, it can cause some bogus parses, so I've disabled it
    for now --SDM

-- discard a state
happyFail  (1) tk old_st (((HappyState (action))):(sts)) 
						(saved_tok `HappyStk` _ `HappyStk` stk) =
--	trace ("discarding state, depth " ++ show (length stk))  $
	action (1) (1) tk (HappyState (action)) sts ((saved_tok`HappyStk`stk))
-}

-- Enter error recovery: generate an error token,
--                       save the old token and carry on.
happyFail  i tk (HappyState (action)) sts stk =
--      trace "entering error recovery" $
	action (1) (1) tk (HappyState (action)) sts ( (HappyErrorToken (i)) `HappyStk` stk)

-- Internal happy errors:

notHappyAtAll :: a
notHappyAtAll = error "Internal Happy error\n"

-----------------------------------------------------------------------------
-- Hack to get the typechecker to accept our action functions







-----------------------------------------------------------------------------
-- Seq-ing.  If the --strict flag is given, then Happy emits 
--	happySeq = happyDoSeq
-- otherwise it emits
-- 	happySeq = happyDontSeq

happyDoSeq, happyDontSeq :: a -> b -> b
happyDoSeq   a b = a `seq` b
happyDontSeq a b = b

-----------------------------------------------------------------------------
-- Don't inline any functions from the template.  GHC has a nasty habit
-- of deciding to inline happyGoto everywhere, which increases the size of
-- the generated parser quite a bit.

{-# LINE 311 "templates\\GenericTemplate.hs" #-}
{-# NOINLINE happyShift #-}
{-# NOINLINE happySpecReduce_0 #-}
{-# NOINLINE happySpecReduce_1 #-}
{-# NOINLINE happySpecReduce_2 #-}
{-# NOINLINE happySpecReduce_3 #-}
{-# NOINLINE happyReduce #-}
{-# NOINLINE happyMonadReduce #-}
{-# NOINLINE happyGoto #-}
{-# NOINLINE happyFail #-}

-- end of Happy Template.
